EasyCoding.uz

Home / Python / Functions

Functions & Modules

Mark Complete

Write reusable functions and organize code with modules.

Functions

def add(a, b):
    return a + b

total = add(5, 7)

Modules

import math

print(math.sqrt(16))
Key takeaway: keep functions small and focused.

Ready to try it yourself?

Write a function and call it.

← Control Flow File Handling →